package org.jeecg.modules.business.doc.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.basic.warehouse.entity.WmsBasicWarehouseAreaLocation;
import org.jeecg.modules.business.doc.business.entity.WmsInReceipt;
import org.jeecg.modules.business.doc.business.entity.WmsInReceiptMaterial;
import org.jeecg.modules.business.doc.business.entity.dto.ListByWarehouseIdResponseVO;
import org.jeecg.modules.business.doc.business.entity.dto.ListWmsInReceiptDTO;
import org.jeecg.modules.business.doc.business.entity.vo.WmsInReceiptQueryVO;
import org.jeecg.modules.business.doc.business.vo.WarehousingStrategyOneParamVO;
import org.jeecg.modules.business.doc.business.vo.WarehousingStrategyOneVO;
import org.jeecg.modules.business.doc.business.vo.WarehousingStrategyParamVO;
import org.jeecg.modules.business.doc.business.vo.WmsInReceiptMaterialResponseVO;
import org.jeecg.modules.business.doc.outbound.entity.vo.UnCreateInVO;
import org.jeecg.modules.business.doc.outbound.entity.vo.UnCreateReqVO;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 入库单
 * @Author: jeecg-boot
 * @Date: 2023-07-31
 * @Version: V1.0
 */
public interface IWmsInReceiptService extends IService<WmsInReceipt> {

    /**
     * 添加一对多
     *
     * @param wmsInReceipt
     * @param wmsInReceiptMaterialList
     */
    public String saveMain(WmsInReceipt wmsInReceipt, List<WmsInReceiptMaterial> wmsInReceiptMaterialList);

    /**
     * 修改一对多
     *
     * @param wmsInReceipt
     * @param wmsInReceiptMaterialList
     */
    public void updateMain(WmsInReceipt wmsInReceipt, List<WmsInReceiptMaterial> wmsInReceiptMaterialList);

    /**
     * 删除一对多
     *
     * @param id
     */
    public void delMain(String id);

    /**
     * 批量删除一对多
     *
     * @param idList
     */
    public void delBatchMain(Collection<? extends Serializable> idList);

    /**
     * 入库任务下查
     *
     * @return
     */
    ListWmsInReceiptDTO listWmsInReceipt(String wmsInReceiptId);

    /**
     * 提交单据
     *
     * @param documentId 单据id
     * @param documentStyle 单据类型 1:入库单 2:入库任务 3:出库单 4:出库任务 5:移库单
     */
    void commit(String documentId,
                String documentStyle);

    /**
     * 通过入库任务id查询入库任务物料对应入库单物料相同字段
     *
     * @param id
     * @return
     */
    List<ListByWarehouseIdResponseVO> listByWarehouseTaskId(String id);

    /**
     * 入库策略-场景一
     * @param param
     * @return
     */
    WarehousingStrategyOneVO warehousingStrategyOne(WarehousingStrategyOneParamVO param);

    /**
     * 入库策略-场景二
     * @param param
     * @return
     */
    WmsBasicWarehouseAreaLocation warehousingStrategy(WarehousingStrategyParamVO param);
    /**
     * 入库单分页查询
     * @param param
     * @return
     */
    IPage<WmsInReceipt> listByPage(Page<WmsInReceipt> pageList, WmsInReceiptQueryVO param);

    /**
     * 补单-查询所有未创建入库单的物料信息
     * @param unCreateReqVO
     * @return
     */
    List<UnCreateInVO> listAllUnCreate(UnCreateReqVO unCreateReqVO);

    /**
     * 选单-查询入库单需要的物料信息
     * @param materialIdList
     * @return
     */
    List<WmsInReceiptMaterialResponseVO> getUnCreateMaterials(List<String> materialIdList);
    /**
     * 入库单-过账
     * @param
     * @return
     */
    Result<Void> inReceiptTransfer(String id);

    /**
     * 盘盈单-过账
     * @param
     * @return
     */
    Result<Void> pydPassSAP(String id);
}
